<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .circle{
            width: 100px;
            height: 100px;
            position: absolute;
            background-color: pink;
            border-radius: 100%;
            /* margin: 150px auto; */
            left: 350px;
            top: 150px;
        }
    </style>
</head>
<body>
    <div class="circle"></div>
    <script>
        let t
        const circle = document.querySelector('.circle')
        let s = 10
        let reg = 180
        // let reg = 0
        let tr = circle.offsetTop
        let lr = circle.offsetLeft
        console.log(circle.offsetTop)
        console.log(circle.offsetLeft)
        console.log(Math.sin(Math.PI / 180 * 90) * 40)
        // console.log(Math.tan(180 / Math.PI * 90))
        onclick = function(){
            clearInterval(t)
            t = setInterval(()=>{
                circle.style.top = Math.sin(Math.PI / 180 * reg) * 200 + tr + 'px'
                circle.style.left = Math.cos(Math.PI / 180 * reg) * 200 + lr + 'px'
                reg += 15
                // circle.offsetTop = Math.sin(Math.PI / 180 * 90) * circle.offsetTop + 'px'
                // if(reg >= 360){
                //     clearInterval(t)
                // }
            },30)
        }
        //Math.sin(Math.PI / 180 * 90)
    </script>
</body>
</html>